using System.Linq;
using UnityEngine;

namespace MaterialUI
{
	public class ButtonRoundInstantiationHelper : InstantiationHelper
	{
		public const int optionMini = 0;

		public const int optionRaised = 1;

		public const int optionHasDropdown = 2;

		[SerializeField]
		private MaterialButton m_Button;

		[SerializeField]
		private MaterialDropdown m_Dropdown;

		[SerializeField]
		private RectTransform m_RectTransform;

		[SerializeField]
		private RectTransform m_ImageRectTransform;

		[SerializeField]
		private RectTransform m_Shadows;

		public override void HelpInstantiate(int[] options)
		{
			m_Button.isCircularButton = true;
			if (options.Contains(0))
			{
				m_Button.contentPadding = new Vector2(16f, 16f);
				m_Button.contentPadding = new Vector2(16f, 16f);
				m_Shadows.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, 180f);
				m_Shadows.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, 180f);
				m_RectTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, 40f);
				m_RectTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, 40f);
				m_ImageRectTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, 40f);
				m_ImageRectTransform.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, 40f);
			}
			if (!options.Contains(1))
			{
				m_Button.isRaisedButton = true;
				m_Button.Convert(noExitGUI: true);
			}
			else
			{
				m_Button.isRaisedButton = true;
			}
			if (!options.Contains(2))
			{
				UnityEngine.Object.DestroyImmediate(m_Dropdown);
				m_Button.buttonObject.onClick = null;
			}
			base.HelpInstantiate(options);
		}
	}
}
